package io;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author: wenjingyuan
 * @Date: 2023/05/29/20:53
 * @Description:
 */
public class OutputStreamDemo5 {
    public static void main(String[] args) throws IOException {
        File file=new File("mytest.txt");
        if(!file.exists()) file.createNewFile();
        //数据追加
        try(FileWriter fileWriter=new FileWriter(file,true)){
            fileWriter.append("\n我是追加的数据");
            fileWriter.flush();
        }
    }
}
